import Mock from 'mockjs'

const { mock } = Mock

// 使用拦截规则拦截命中的请求
mock("/api/posts", "get", {
    code: 200,
    data: {
        total: 10,
        list: Array.from({length: 10}, () => ({
            id: Mock.Random.id(),
            postCode: Mock.Random.string('upper', 4),
            postName: Mock.Random.pick(['总经理', '副总经理', '技术总监', '产品经理', '开发工程师', '测试工程师', '运维工程师', 'UI设计师', '市场经理', '销售经理']),
            postSort: Mock.Random.integer(1, 10),
            status: Mock.Random.pick(['0', '1']),
            createdTime: Mock.Random.datetime(),
            createdBy: Mock.Random.cname(),
            updatedTime: Mock.Random.datetime(),
            updatedBy: Mock.Random.cname(),
            remark: Mock.Random.csentence(10, 15)
        }))
    }
}) 